-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RLlib] Use config
(not self.config
) in Learner.compute_loss_for_module
to prepare these for multi-agent-capability.
#45053
[RLlib] Use config
(not self.config
) in Learner.compute_loss_for_module
to prepare these for multi-agent-capability.
#45053
Conversation
Signed-off-by: sven1977 <[email protected]>
…ics_do_over_03_learner_on_new_metrics_logger Signed-off-by: sven1977 <[email protected]> # Conflicts: # rllib/algorithms/ppo/ppo_learner.py # rllib/algorithms/ppo/tf/ppo_tf_learner.py # rllib/algorithms/ppo/torch/ppo_torch_learner.py
Signed-off-by: sven1977 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great PR! Getting multi-agent off-policy ready.
@@ -72,7 +72,7 @@ def compute_loss_for_module( | |||
trajectory_len=rollout_frag_or_episode_len, | |||
recurrent_seq_len=recurrent_seq_len, | |||
) | |||
if self.config.enable_env_runner_and_connector_v2: | |||
if config.enable_env_runner_and_connector_v2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, if the new env runners work on APPO/IMPALA. In my test case they do not in the MA case where a list of episodes is tried to be compressed_if_needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMPALA and APPO are WIP on the new EnvRunners, officially not supported yet.
https://docs.ray.io/en/master/rllib/rllib-new-api-stack.html
@@ -61,7 +61,7 @@ def compute_loss_for_module( | |||
).squeeze() | |||
|
|||
# Use double Q learning. | |||
if self.config.double_q: | |||
if config.double_q: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch. I had the same changed in another PR on the side. This would have been led to some bugs in MA off-policy.
).items() | ||
} | ||
) | ||
for module_id in set(loss_per_module.keys()) - {ALL_MODULES}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! MA-ready.
…self_config_in_learner_compute_loss Signed-off-by: sven1977 <[email protected]> # Conflicts: # rllib/algorithms/sac/torch/sac_torch_learner.py
Use
config
(notself.config
) inLearner.compute_loss_for_module
to prepare these for multi-agent-capability.compute_gradients
to NOT use DEFAULT_POLICY anymore, but to actually loop through the different RLModules.Why are these changes needed?
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.